using System;
namespace ch.ethz.ssh2.packets
{
	
	/// <summary> PacketGlobalCancelForwardRequest.
	/// 
	/// </summary>
	/// <author>  Christian Plattner
	/// </author>
	/// <version>  2.50, 03/15/10
	/// </version>
	public class PacketGlobalCancelForwardRequest
	{
		virtual public byte[] Payload
		{
			get
			{
				if (payload == null)
				{
					TypesWriter tw = new TypesWriter();
					tw.writeByte(Packets.SSH_MSG_GLOBAL_REQUEST);
					
					tw.writeString("cancel-tcpip-forward");
					tw.writeBoolean(wantReply);
					tw.writeString(bindAddress);
					tw.writeUINT32(bindPort);
					
					payload = tw.getBytes();
				}
				return payload;
			}
			
		}
		internal byte[] payload;
		
		public bool wantReply;
		public System.String bindAddress;
		public int bindPort;
		
		public PacketGlobalCancelForwardRequest(bool wantReply, System.String bindAddress, int bindPort)
		{
			this.wantReply = wantReply;
			this.bindAddress = bindAddress;
			this.bindPort = bindPort;
		}
	}
}